Skip to content

feat: add support for L1 fee buffers in gas calculations for multiple coin families#8292

Draft
shubham-damkondwar wants to merge 1 commit intomasterfrom
CECHO-354
Draft

feat: add support for L1 fee buffers in gas calculations for multiple coin families#8292
shubham-damkondwar wants to merge 1 commit intomasterfrom
CECHO-354

Conversation

@shubham-damkondwar
Copy link
Contributor

TICKET: CECHO-354

@shubham-damkondwar
Copy link
Contributor Author

@claude please review

@shubham-damkondwar shubham-damkondwar force-pushed the CECHO-354 branch 2 times, most recently from cef744a to a479e73 Compare March 16, 2026 12:39
@shubham-damkondwar
Copy link
Contributor Author

@claude please review

@shubham-damkondwar shubham-damkondwar marked this pull request as ready for review March 19, 2026 10:54
@shubham-damkondwar shubham-damkondwar requested review from a team as code owners March 19, 2026 10:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a generalized L1 data-fee buffer into ETH-like recovery gas calculations so additional L2 coin families can account for extra L1 fees during balance checks and sweep amount computation.

Changes:

  • Renamed the gas config field to a generic l1GasFeeBuffer.
  • Applied the L1 fee buffer for a configurable set of coin families (instead of only opeth) in both base-coin and token recovery paths.
  • Ignored .worktrees/ in git.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
modules/statics/src/tokenConfig.ts Renames the L1 fee buffer config to a generic key (l1GasFeeBuffer).
modules/abstract-eth/src/ethLikeToken.ts Applies L1 fee buffer to token recovery gas-needed calculation for selected families.
modules/abstract-eth/src/abstractEthLikeNewCoins.ts Introduces family allowlist and applies L1 fee buffer in recovery/balance validation flows.
.gitignore Adds .worktrees/ to ignored paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

export abstract class AbstractEthLikeNewCoins extends AbstractEthLikeCoin {
static hopTransactionSalt = 'bitgoHopAddressRequestSalt';
protected readonly sendMethodName: 'sendMultiSig' | 'sendMultiSigToken';
protected readonly coinFamiliesWithL1Fees: ReadonlyArray<string> = ['opeth', 'dogeos', 'morpheth'];
Comment on lines +1520 to +1522
// On L2 chains with L1 data fees, add buffer for L1 fees
if (this.staticsCoin?.family !== undefined && this.coinFamiliesWithL1Fees.includes(this.staticsCoin.family)) {
totalGasNeeded = totalGasNeeded.add(new optionalDeps.ethUtil.BN(ethGasConfigs.l1GasFeeBuffer));
Comment on lines +1520 to +1522
// On L2 chains with L1 data fees, add buffer for L1 fees
if (this.staticsCoin?.family !== undefined && this.coinFamiliesWithL1Fees.includes(this.staticsCoin.family)) {
totalGasNeeded = totalGasNeeded.add(new optionalDeps.ethUtil.BN(ethGasConfigs.l1GasFeeBuffer));
Comment on lines +279 to +281
// On L2 chains with L1 data fees, add buffer for L1 fees
if (this.staticsCoin?.family !== undefined && this.coinFamiliesWithL1Fees.includes(this.staticsCoin.family)) {
totalGasNeeded = totalGasNeeded.add(new optionalDeps.ethUtil.BN(ethGasConfigs.l1GasFeeBuffer));
Copy link
Contributor

@pranavjain97 pranavjain97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In draft, flushing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants